package org.hypnus.e.engine.message;

import java.util.HashMap;
import java.util.Map;

public class EngineContext {

	private Map<String, Object> dataMap ;
	
	private String serviceId ;
	
	private String serviceEntry ;
	
	private boolean isException ;
	
	private boolean isEnd ;
	
	public boolean isEnd() {
		return isEnd;
	}

	public void setEnd(boolean isEnd) {
		this.isEnd = isEnd;
	}

	public boolean isException() {
		return isException;
	}

	public void setException(boolean isException) {
		this.isException = isException;
	}

	public String getServiceEntry() {
		return serviceEntry;
	}

	public void setServiceEntry(String serviceEntry) {
		this.serviceEntry = serviceEntry;
	}

	public String getServiceId() {
		return serviceId;
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	public Map<String, Object> getDataMap() {
		return dataMap;
	}

	public void addData(Object obj){
		if(dataMap==null){
			dataMap = new HashMap<String, Object>();
		}
		if(serviceId == null){
			throw new IllegalArgumentException("pre init the value of field [serviceid]! ") ;
		}
		dataMap.put(serviceId, obj) ;
	}

}
